// WindoTypeDlg.cpp : implementation file
//

#include "StdAfx.h"
#include "resource.h"
#include "WindoTypeDlg.h"

#include ".\\Ch7_7Res\\Resource.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern HINSTANCE _hdllInstance;

/////////////////////////////////////////////////////////////////////////////
// CWindoTypeDlg dialog


CWindoTypeDlg::CWindoTypeDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CWindoTypeDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CWindoTypeDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CWindoTypeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWindoTypeDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CWindoTypeDlg, CDialog)
	//{{AFX_MSG_MAP(CWindoTypeDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWindoTypeDlg message handlers

BOOL CWindoTypeDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	// Set the hResource to the resource only DLL
	HINSTANCE hResDLL = LoadLibrary("Ch7_7Res.dll");

	AfxSetResourceHandle(hResDLL);

	CString strTitle;
	strTitle.LoadString(IDS_TITLE);

	CString strWindoType;
	strWindoType.LoadString(IDS_WINDOTYPE);

	CString strWindoSpecs;
	strWindoSpecs.LoadString(IDS_WINDOSPECS);

	CString strRbRect;
	strRbRect.LoadString(IDS_RB_RECT);

	CString strRbArch;
	strRbArch.LoadString(IDS_RB_ARCH);

	CString strRbApex;
	strRbApex.LoadString(IDS_RB_APEX);

	CString strEditWidth;
	strEditWidth.LoadString(IDS_EDIT_WIDTH);

	CString strEditHeight;
	strEditHeight.LoadString(IDS_EDIT_HEIGHT);

	CString strEditCols;
	strEditCols.LoadString(IDS_EDIT_COLS);

	CString strEditRows;
	strEditRows.LoadString(IDS_EDIT_ROWS);

	CString strBtnOk;
	strBtnOk.LoadString(IDS_BTN_OK);

	CString strBtnCancel;
	strBtnCancel.LoadString(IDS_BTN_CANCEL);

	AfxSetResourceHandle(_hdllInstance);

	CButton *pWindoType;
	pWindoType = (CButton *) GetDlgItem(IDC_RB_TYPERECT);
	pWindoType->SetCheck(1);

	SetWindowText(strTitle);
	GetDlgItem(IDC_TXT_WINDOTYPE)->SetWindowText(strTitle);
	GetDlgItem(IDC_TXT_WINDOSPECS)->SetWindowText(strWindoSpecs);
	GetDlgItem(IDC_RB_TYPERECT)->SetWindowText(strRbRect);
	GetDlgItem(IDC_RB_TYPEARCH)->SetWindowText(strRbArch);
	GetDlgItem(IDC_RB_TYPEAPEX)->SetWindowText(strRbApex);
	GetDlgItem(IDC_TXT_HEIGHT)->SetWindowText(strEditHeight);
	GetDlgItem(IDC_TXT_WIDTH)->SetWindowText(strEditWidth);
	GetDlgItem(IDC_TXT_COLS)->SetWindowText(strEditCols);
	GetDlgItem(IDC_TXT_ROWS)->SetWindowText(strEditRows);
	GetDlgItem(IDOK)->SetWindowText(strBtnOk);
	GetDlgItem(IDCANCEL)->SetWindowText(strBtnCancel);

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
